<!DOCTYPE html>
<html lang="zh-CN">

  
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  <meta name="author" content="董沅鑫, yuanxin.me@gmail.com">
  
  
  
  <title>测试 | 您自己的网站标题</title>

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

  
    <meta name="keywords" content="测试,demo,sample,">
  

  <script>
    console.log('\n%c Hexo-theme-bmw v4.0 ' + '%c 🎉 https://github.com/dongyuanxin/theme-bmw 🎉\n' + '\n%c View demo online ' + '%c 🔍 https://godbmw.com/ 🔍  \n' , 'color: #fadfa3; background: #030307; padding:3px 0;', '', 'color: #fadfa3; background: #030307; padding:3px 0;', '');
  </script>

  
    <meta name="description" content="您自己的网站描述">
  

  

  
    <link rel="icon" href="/images/favicon.ico">
    <link rel="apple-touch-icon" href="/images/touch-icon.png">
  

  <link href="https://cdn.bootcss.com/fancybox/3.5.2/jquery.fancybox.min.css" rel="stylesheet">
  <link rel="stylesheet" href="/sydblog/css/base.css">
<link rel="stylesheet" href="/sydblog/icon/iconfont.css">
<link rel="stylesheet" href="/sydblog/css/github-markdown.css">
<link rel="stylesheet" href="/sydblog/css/highlight.css">

  <script src="/sydblog/js/util.js"></script>
<script src="/sydblog/js/valine.min.js"></script>

  

  
    <link href="https://cdn.bootcss.com/aplayer/1.10.1/APlayer.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/aplayer/1.10.1/APlayer.min.js" async></script>
  

  
    <link href="https://cdn.bootcss.com/social-share.js/1.0.16/css/share.min.css" rel="stylesheet">
  
  
  <script src="//cdn.bootcss.com/jquery/3.3.1/jquery.min.js" async></script>
  
  
    <script src="//cdn.jsdelivr.net/npm/leancloud-storage@3.11.0/dist/av-min.js"></script>
  

</head>

  <body>

    

    <div id="app">

      <div class="header-wrap">
  <header>
    <div class="site-brand">
      <div class="site-title">
        <a href="/sydblog/">邵亚东博客</a>
      </div>
    </div>
    <nav class="site-navigation">
      <ul class="nav-menu">
      
        <li class="nav-item" data-path="/">
          
            <a href="/sydblog/" target="_self">
              主页
            </a>
          
        </li>
      
        <li class="nav-item" data-path="/archives/">
          
            <a href="/sydblog/archives/" target="_self">
              归档
            </a>
          
        </li>
      
        <li class="nav-item" data-path="/categories/">
          
            <a href="/sydblog/categories/" target="_self">
              分类
            </a>
          
        </li>
      
        <li class="nav-item" data-path="/tags/">
          
            <a href="/sydblog/tags/" target="_self">
              标签
            </a>
          
        </li>
      
        <li class="nav-item" data-path="/friends/">
          
            <a href="/sydblog/friends/" target="_self">
              友链
            </a>
          
        </li>
      
        <li class="nav-item" data-path="/about/">
          
            <a href="/sydblog/about/" target="_self">
              关于
            </a>
          
        </li>
      
        <li class="nav-item" data-path="">
          
            <a href="javascript:void(0);" v-else="">下拉菜单</a>
            <ul class="nav-menu--dropdown">
              
                <li>
                  <a href="https://github.com/dongyuanxin" target="_blank">
                    Github
                  </a>
                </li>
              
                <li>
                  <a href="https://www.zhihu.com/people/godbmw/activities" target="_blank">
                    知乎
                  </a>
                </li>
              
            </ul>
          
        </li>
      
      </ul>
    </nav>
    <i class="iconfont icon-menu"></i>
  </header>
</div>

<script>
  let links = document.querySelectorAll('.nav-item');
  for(let link of links){
    let childrenLink = link.querySelector('ul');
    link.addEventListener('mouseenter', () => {
      if(childrenLink) {
        childrenLink.className = "nav-menu--dropdown active";
      }
    })
    link.addEventListener('mouseleave', () => {
      if(childrenLink) {
        childrenLink.className = "nav-menu--dropdown";
      }
    })
  }
  let rootRealPath = getRealPath(window.location.pathname, true);
  for(let link of links) {
    let linkPath = link.getAttribute("data-path");
    if(linkPath && getRealPath(linkPath, true) === rootRealPath) {
      link.className = "nav-item hover";
    }
  }

  let iconMenu = document.querySelector("i.iconfont.icon-menu"),
    iconMenuClicked = false;
  let navDOM = document.querySelector("nav.site-navigation");
  iconMenu.addEventListener("click", () => {
    iconMenuClicked 
      ? navDOM.className = "site-navigation active"
      : navDOM.className = "site-navigation";
    iconMenuClicked = !iconMenuClicked;
  })
</script>

      








<div class="container post-index">

  

<div class="post">
  <h1 class="article-title">
    <span>测试</span>
  </h1>
  <div class="article-top-meta">
    <span>
      发布 : 
      2019-01-17
    </span>
    
      <span>
        分类 : 
          <a href="/sydblog/categories/测试/">
            测试
          </a>
      </span>
    
    
      <span>
        浏览 : <span class="article-timer" data-identity="测试"></span>
      </span>
    
  </div>

  
    <div id="测试" style="margin: 4rem 2px"></div>
<script async>
  (function(){
    let playerTimer = setInterval(function(){
      if(!window.APlayer){
        return
      }

      new APlayer({
        container: document.getElementById('测试'),
        theme: '#e96900',
        listFolded: false,
        audio: [{"name":"Where are you","artist":"AniFace","url":"//music.163.com/song/media/outer/url?id=453843751.mp3","cover":"//p1.music.126.net/AUfXMljLBgB3PBV731IzRg==/109951162857118370.jpg?param=130y130"},{"name":"END THEME","artist":"天門","url":"http://music.163.com/song/media/outer/url?id=528306.mp3","cover":"//p1.music.126.net/1sw_ptPeI_GNm58VBW1udQ==/2504687488135369.jpg?param=130y130"}]
      });
      
      clearInterval(playerTimer)
    }, 10);
  })()
</script>
  

  <div class="article-content">
    <div class="markdown-body">
      <h1 id="这里是最大的一个标题"><a href="#这里是最大的一个标题" class="headerlink" title="这里是最大的一个标题"></a>这里是最大的一个标题</h1><p>一个井号的第一号标题貌似在博客系统中没什么鬼用处, 两个井号的标题可以在最右侧显示.</p>
<h2 id="这里是使用本地图片哦"><a href="#这里是使用本地图片哦" class="headerlink" title="这里是使用本地图片哦:"></a>这里是使用本地图片哦:</h2><ol>
<li>首先将post_asset_folder 选项设为 true</li>
<li>使用<code>hexo new [博客标题]</code>生成md文件和同名文件夹</li>
<li>将使用到的图片copy到文件夹中</li>
<li>使用下面的代码引用图片</li>
</ol>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">&#123;% asset_img sample.jpg This is an example image %&#125;</span><br></pre></td></tr></table></figure>
<img src="/sydblog/2019/01/17/测试/sample.jpg" title="This is an example image">
<p>下面测试网络图片</p>
<p><img src="https://timgsa.baidu.com/timg?image&amp;quality=80&amp;size=b9999_10000&amp;sec=1511855324868&amp;di=a5d731287c272b2fb407bcfa3cdf1e1e&amp;imgtype=jpg&amp;src=http%3A%2F%2Fimg3.imgtn.bdimg.com%2Fit%2Fu%3D3907036618%2C55725399%26fm%3D214%26gp%3D0.jpg" alt="图片" title="这也是有提示信息的"></p>
<h2 id="粗体和斜体"><a href="#粗体和斜体" class="headerlink" title="粗体和斜体"></a>粗体和斜体</h2><p><strong>粗体使用两个星号包起来</strong><br><em>斜体是使用一个星号包起来</em></p>
<h2 id="超级链接和无序列表"><a href="#超级链接和无序列表" class="headerlink" title="超级链接和无序列表"></a>超级链接和无序列表</h2><p>超级链接是这样的 <a href="http://www.baidu.com" target="_blank" rel="noopener">百度</a>.</p>
<p>下面来试一下无序列表, 据说使用 -, + , * 都是可以的</p>
<ul>
<li>列表一  </li>
</ul>
<ul>
<li>列表二  </li>
</ul>
<ul>
<li>列表三  </li>
<li>为什么不是圆点呢?</li>
</ul>
<p>下面来试验一下有序列表</p>
<ol>
<li>第一行</li>
<li>第二行</li>
<li>第三行</li>
</ol>
<h2 id="代码"><a href="#代码" class="headerlink" title="代码"></a>代码</h2><p>使用三个反引号来包裹</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line">  &quot;name&quot;: &quot;hexo-site&quot;,</span><br><span class="line">  &quot;version&quot;: &quot;0.0.0&quot;,</span><br><span class="line">  &quot;private&quot;: true,</span><br><span class="line">  &quot;hexo&quot;: &#123;</span><br><span class="line">    &quot;version&quot;: &quot;3.8.0&quot;</span><br><span class="line">  &#125;,</span><br><span class="line">  &quot;dependencies&quot;: &#123;</span><br><span class="line">    &quot;hexo&quot;: &quot;^3.7.0&quot;,</span><br><span class="line">    &quot;hexo-deployer-git&quot;: &quot;^1.0.0&quot;,</span><br><span class="line">    &quot;hexo-generator-archive&quot;: &quot;^0.1.5&quot;,</span><br><span class="line">    &quot;hexo-generator-category&quot;: &quot;^0.1.3&quot;,</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<h2 id="tab键的作用-暂时我不知道"><a href="#tab键的作用-暂时我不知道" class="headerlink" title="tab键的作用, 暂时我不知道"></a>tab键的作用, 暂时我不知道</h2><pre><code>这是第一个tab
这是第二个tab
这是第三个tab
</code></pre><p>or </p>
<pre><code>里面其他的不起作用了1
里面其他的不起作用了2
里面其他的不起作用了3
</code></pre><h2 id="链接和邮件"><a href="#链接和邮件" class="headerlink" title="链接和邮件"></a>链接和邮件</h2><h3 id="Inline"><a href="#Inline" class="headerlink" title="Inline"></a>Inline</h3><p>写法: <code>&lt;uranusjr@gmail.com&gt;</code> 效果 <a href="mailto:&#117;&#114;&#x61;&#110;&#117;&#115;&#106;&#114;&#x40;&#x67;&#109;&#97;&#105;&#108;&#x2e;&#x63;&#111;&#109;" target="_blank" rel="noopener">&#117;&#114;&#x61;&#110;&#117;&#115;&#106;&#114;&#x40;&#x67;&#109;&#97;&#105;&#108;&#x2e;&#x63;&#111;&#109;</a></p>
<p>写法: <code>&lt;http://macdown.uranusjr.com&gt;</code> 效果 <a href="http://macdown.uranusjr.com" target="_blank" rel="noopener">http://macdown.uranusjr.com</a></p>
<p>写法: <code>[Macdown Website](http://macdown.uranusjr.com &quot;鼠标放上来有提示信息&quot;)</code> 效果 <a href="http://macdown.uranusjr.com" title="鼠标放上来有提示信息" target="_blank" rel="noopener">Macdown Website</a>  </p>
<h2 id="引用"><a href="#引用" class="headerlink" title="引用"></a>引用</h2><blockquote>
<p>不知道这个是不是引用啊<br>第二个引用是在这里呀, 不能自动换行,不开心, 要换行还是要加上两个空格  </p>
<blockquote>
<p>好像这里可以嵌套使用  </p>
</blockquote>
<p>还可以使用无序列表吗? 可以使用, 但是需要一个空行</p>
<ul>
<li>并且还要是…  </li>
<li>不行啊, 测试不出来, 不知道为什么</li>
<li>麻蛋, 看起来是要一个&gt;, 一句话, 再一个&gt; , 之后才能使用</li>
</ul>
</blockquote>
<h2 id="分割线"><a href="#分割线" class="headerlink" title="分割线"></a>分割线</h2><p>据说可以使用下面几个符号, 三个以上就会出现分割线, 但是在博客中貌似不起作用.</p>
<blockquote>
<p><code>***</code><br><code>---</code><br><code>波浪线</code>, 不知道为什么这里不能用<br><code>___</code></p>
</blockquote>
<h2 id="代码code"><a href="#代码code" class="headerlink" title="代码code"></a>代码code</h2><p>据说支持代码高亮, 在博客中可以用哦, 好像还可以.<br><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//设置默认的props</span></span><br><span class="line"><span class="keyword">static</span> defaultProps = &#123; <span class="attr">user</span>: &#123;<span class="attr">id</span>: <span class="string">''</span>, <span class="attr">name</span>: <span class="string">''</span>, <span class="attr">url</span>: <span class="string">''</span>, <span class="attr">email</span>: <span class="string">''</span>&#125;&#125;</span><br><span class="line"><span class="comment">//这个组件中查询的userName是变化的，所以应该定义一个变量来存放</span></span><br><span class="line"><span class="comment">//设置默认state是在构造函数里面</span></span><br><span class="line"><span class="keyword">constructor</span>(props) &#123;</span><br><span class="line">  <span class="keyword">super</span>(props);</span><br><span class="line">  <span class="keyword">this</span>.state = &#123; <span class="attr">userName</span>: <span class="string">''</span> &#125;;</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">//定义了一个方法触发fetchUser action操作</span></span><br><span class="line"><span class="comment">//不知道为什么这里不能使用const来定义</span></span><br><span class="line">_onPressFetchUser = <span class="function"><span class="params">()</span> =&gt;</span> &#123;</span><br><span class="line">  <span class="keyword">this</span>.props.dispatch(fetchUser(<span class="keyword">this</span>.state.userName));</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<h2 id="多选框"><a href="#多选框" class="headerlink" title="多选框"></a>多选框</h2><p>下面是多选框的例子, 好像要配合无序/有序列表使用</p>
<ol>
<li style="list-style: none"><input type="checkbox" checked> 你好, 我这里是选中的<ul>
<li style="list-style: none"><input type="checkbox" checked> 无序列表1</li>
<li style="list-style: none"><input type="checkbox" checked> 无序列表2</li>
<li style="list-style: none"><input type="checkbox" checked> 无序列表3</li>
</ul>
</li>
<li style="list-style: none"><input type="checkbox"> 你好呀, 我这里是没有选中的.<ul>
<li style="list-style: none"><input type="checkbox"> 无序列表1</li>
<li style="list-style: none"><input type="checkbox"> 无序列表2</li>
<li style="list-style: none"><input type="checkbox"> 无序列表3</li>
</ul>
</li>
</ol>
<h2 id="表格"><a href="#表格" class="headerlink" title="表格"></a>表格</h2><h3 id="一般表格"><a href="#一般表格" class="headerlink" title="一般表格"></a>一般表格</h3><table>
<thead>
<tr>
<th>First Header</th>
<th>Second Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>Content Cell</td>
<td>Content Cell</td>
</tr>
<tr>
<td>Content Cell</td>
<td>Content Cell</td>
</tr>
</tbody>
</table>
<p>你还可以设置表格列对齐方式:</p>
<table>
<thead>
<tr>
<th style="text-align:left">Left Aligned</th>
<th style="text-align:center">Center Aligned</th>
<th style="text-align:right">Right Aligned</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">col 3 is</td>
<td style="text-align:center">some wordy text</td>
<td style="text-align:right">$1600</td>
</tr>
<tr>
<td style="text-align:left">col 2 is</td>
<td style="text-align:center">centered</td>
<td style="text-align:right">$12</td>
</tr>
<tr>
<td style="text-align:left">zebra stripes</td>
<td style="text-align:center">are neat</td>
<td style="text-align:right">$1</td>
</tr>
</tbody>
</table>
<p>依靠第二行<code>:</code>来设置对齐方式</p>
<blockquote>
<p>|:—– |代表左对齐<br>|:—–:|代表居中<br>| —–:|代表右对齐</p>
</blockquote>
<h3 id="Inline表格"><a href="#Inline表格" class="headerlink" title="Inline表格"></a>Inline表格</h3><p>表格中也可以使用markdown标签:</p>
<table>
<thead>
<tr>
<th>Option name</th>
<th>Markup</th>
<th>Result if enabled</th>
</tr>
</thead>
<tbody>
<tr>
<td>Intra-word emphasis</td>
<td>So A*maz*ing</td>
<td>So A<em>maz</em>ing</td>
<td></td>
</tr>
<tr>
<td>Strikethrough</td>
<td>~~Much wow~~</td>
<td><del>Much wow</del></td>
<td></td>
</tr>
<tr>
<td>Underline [^under]</td>
<td>_So doge_</td>
<td><u>So doge</u></td>
<td></td>
</tr>
<tr>
<td>Quote [^quote]</td>
<td>\”Such editor\”</td>
<td><q>Such editor</q></td>
<td></td>
</tr>
<tr>
<td>Highlight</td>
<td>\==So good\==</td>
<td><mark>So good</mark></td>
<td></td>
</tr>
<tr>
<td>Superscript</td>
<td>hoge\^(fuga)</td>
<td>hoge<sup>fuga</sup></td>
<td></td>
</tr>
<tr>
<td>Autolink</td>
<td><a href="http://t.co" target="_blank" rel="noopener">http://t.co</a></td>
<td><a href="http://t.co" target="_blank" rel="noopener">http://t.co</a></td>
<td></td>
</tr>
<tr>
<td>Footnotes</td>
<td>[\^4] and [\^4]:</td>
<td>[^4] and footnote 4</td>
<td></td>
</tr>
</tbody>
</table>
<p>[^4]: You don’t have to use a number. Arbitrary things like <code>[^footy note4]</code> and <code>[^footy note4]:</code> will also work. But they will <em>render</em> as numbered footnotes. Also, no need to keep your footnotes in order, I will sort out the order for you so they appear in the same order they were referenced in the text body. You can even keep some footnotes near where you referenced them, and collect others at the bottom of the file in the traditional place for footnotes. </p>
<h2 id="The-Rendering-Preference-Pane"><a href="#The-Rendering-Preference-Pane" class="headerlink" title="The Rendering Preference Pane"></a>The Rendering Preference Pane</h2><p>This is where I keep preferences relating to how I render and style the parsed markdown in the preview window.<br><img src="http://d.pr/i/rT4d+" alt="Rendering preferences pane"></p>
<h3 id="CSS"><a href="#CSS" class="headerlink" title="CSS"></a>CSS</h3><p>You can choose different css files for me to use to render your html. You can even customize or add your own custom css files.</p>
<h3 id="Syntax-Highlighting"><a href="#Syntax-Highlighting" class="headerlink" title="Syntax Highlighting"></a>Syntax Highlighting</h3><p>You have already seen how I can syntax highlight your fenced code blocks. See the <a href="#fenced-code-block">Fenced Code Block</a> section if you haven’t! You can also choose different themes for syntax highlighting.</p>
<h3 id="TeX-like-Math-Syntax"><a href="#TeX-like-Math-Syntax" class="headerlink" title="TeX-like Math Syntax"></a>TeX-like Math Syntax</h3><p>I can also render TeX-like math syntaxes, if you allow me to.[^math] I can do inline math like this: \( 1 + 1 \) or this (in MathML): <math><mn>1</mn><mo>+</mo><mn>1</mn></math>, and block math:</p>
<p>\[<br>    A^T_S = B<br>\]</p>
<p>or (in MathML)</p>
<math display="block"><br>    <msubsup><mi>A</mi> <mi>S</mi> <mi>T</mi></msubsup><br>    <mo>=</mo><br>    <mi>B</mi><br></math>



<h3 id="Task-List-Syntax"><a href="#Task-List-Syntax" class="headerlink" title="Task List Syntax"></a>Task List Syntax</h3><ol>
<li style="list-style: none"><input type="checkbox" checked> I can render checkbox list syntax<ul>
<li style="list-style: none"><input type="checkbox" checked> I support nesting</li>
<li style="list-style: none"><input type="checkbox" checked> I support ordered <em>and</em> unordered lists</li>
</ul>
</li>
<li style="list-style: none"><input type="checkbox"> I don’t support clicking checkboxes directly in the html window</li>
</ol>
<h3 id="Jekyll-front-matter"><a href="#Jekyll-front-matter" class="headerlink" title="Jekyll front-matter"></a>Jekyll front-matter</h3><p>If you like, I can display Jekyll front-matter in a nice table. Just make sure you put the front-matter at the very beginning of the file, and fence it with <code>---</code>. For example:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: &quot;Macdown is my friend&quot;</span><br><span class="line">date: 2014-06-06 20:00:00</span><br><span class="line">---</span><br></pre></td></tr></table></figure>
<h3 id="Render-newline-literally"><a href="#Render-newline-literally" class="headerlink" title="Render newline literally"></a>Render newline literally</h3><p>Normally I require you to put two spaces and a newline (aka return) at the end of a line in order to create a line break. If you like, I can render a newline any time you end a line with a newline. However, if you enable this, markdown that looks lovely when I render it might look pretty funky when you let some <em>other</em> program render it.</p>
<h2 id="The-General-Preferences-Pane"><a href="#The-General-Preferences-Pane" class="headerlink" title="The General Preferences Pane"></a>The General Preferences Pane</h2><p>This is where I keep preferences related to application behavior.<br><img src="http://d.pr/i/rvwu+" alt="General preferences pane"></p>
<p>The General Preferences Pane allows you to tell me how you want me to behave. For example, do you want me to make sure there is a document open when I launch? You can also tell me if I should constantly update the preview window as you type, or wait for you to hit <code>command-R</code> instead. Maybe you prefer your editor window on the right? Or to see the word-count as you type. This is also the place to tell me if you are interested in pre-releases of me, or just want to stick to better-tested official releases.  </p>
<h2 id="The-Editor-Preference-Pane"><a href="#The-Editor-Preference-Pane" class="headerlink" title="The Editor Preference Pane"></a>The Editor Preference Pane</h2><p>This is where I keep preferences related to the behavior and styling of the editing window.<br><img src="http://d.pr/i/6OL5+" alt="Editor preferences pane"></p>
<h3 id="Styling"><a href="#Styling" class="headerlink" title="Styling"></a>Styling</h3><p>My editor provides syntax highlighting. You can edit the base font and the coloring/sizing theme. I provided some default themes (courtesy of <a href="http://mouapp.com" target="_blank" rel="noopener">Mou</a>’s creator, Chen Luo) if you don’t know where to start.</p>
<p>You can also edit, or even add new themes if you want to! Just click the <strong><em>Reveal</em></strong> button, and start moving things around. Remember to use the correct file extension (<code>.styles</code>), though. I’m picky about that.</p>
<p>I offer auto-completion and other functions to ease your editing experience. If you don’t like it, however, you can turn them off.</p>
<h2 id="Hack-On"><a href="#Hack-On" class="headerlink" title="Hack On"></a>Hack On</h2><p>That’s about it. Thanks for listening. I’ll be quiet from now on (unless there’s an update about the app—I’ll remind you for that!).</p>
<p>Happy writing!</p>
<p>[^emphasize]: If <strong>Underlines</strong> is turned on, <code>_this notation_</code> will render as underlined instead of emphasized </p>
<p>[^under]: If <strong>Underline</strong> is disabled <code>_this_</code> will be rendered as <em>emphasized</em> instead of being underlined.</p>
<p>[^quote]: <strong>Quote</strong> replaces literal <code>&quot;</code> characters with html <code>&lt;q&gt;</code> tags. <strong>Quote</strong> and <strong>Smartypants</strong> are syntactically incompatible. If both are enabled, <strong>Quote</strong> takes precedence. Note that <strong>Quote</strong> is different from <em>blockquote</em>, which is part of standard Markdown.</p>
<p>[^math]: Internet connection required.</p>
    </div>
  </div>
  
  
  
    <div class="social-share" style="margin-top: -2rem" data-wechat-qrcode-title="<p>微信扫一扫</p>" data-wechat-qrcode-helper="<p>微信右上角, 扫一扫分享</p>" data-sites="qq, wechat, weibo">
  <span style="color: #6b7487; font-size: 1.4rem;">分享到: </span>
</div>
<script src="https://cdn.bootcss.com/social-share.js/1.0.16/js/social-share.min.js" async></script>
  

  

  <div class="article-footer">
    <div class="article-meta pull-left">
      <span>
        
          <i class="iconfont icon-06tags"></i>标签: 
          
          <span class="span--tag">
            <a href="/sydblog/tags/demo/">
              #demo
            </a>
          </span>
          
          <span class="span--tag">
            <a href="/sydblog/tags/sample/">
              #sample
            </a>
          </span>
          
        
      </span>
    </div>
    <div class="article-meta pull-right">
    </div>
  </div>
</div>


  <aside id="sidebar">
    <p id="sidebar-header"></p>
    <ol id="sidebar-toc"></ol>
  </aside>
  <script async>setTimeout(generateToc, 10);</script>


  <nav class="post-navigation">
    
    
      <div class="nav-next">
        下一篇:
        <a href="/sydblog/2019/01/17/hexo-theme-bmw在码云上部署/" target="_self">hexo+theme-bmw在码云上部署</a>
        <i class="iconfont icon-next"></i>
      </div>
    
  </nav>

   

  
    <script defer>
const valineAPI = (() => {
  try {
    AV.init("Hyq9wkH495DgNHWhDQCOfQSp-gzGzoHsz", "WaR7nrzhliHj9aVwdQzkdlGd");
  } catch(error) {}
  const isExist = (identity) => {
    identity = identity || getRealPath();
    let query = new AV.Query('Timer');
    return new Promise((resolve, reject) => {
      query.equalTo("identity", identity);
      query.find().then(results => {
        resolve(results.length > 0);
      }, error => reject(error));
    })
  }

  const _get = (identity) => {
    let query = null;
    if(identity && identity instanceof Array){
      let querys = [];
      for(let i = 0; i < identity.length; ++i) {
        querys[i] = new AV.Query('Timer');
        querys[i].equalTo('identity', identity[i]);
      }
      query = AV.Query.or.apply(null ,querys);
    } else {
      identity = identity || getRealPath();
      query = new AV.Query("Timer");
      query.equalTo("identity", identity);
    }

    return new Promise((resolve, reject) => {
      query.find()
      .then(results => resolve(results))
      .catch(error => reject(error))
    })
  }

  const create = (identity) => {
    identity = identity || getRealPath();
    return new Promise((resolve, reject) => {
      let Todo = AV.Object.extend('Timer');
      let todo = new Todo();
      todo.set("times", 1);
      todo.set("identity", identity);
      todo.save().then(res => resolve(true), error => reject(error));
    })
  }

  const update = (identity) => {
    identity = identity || getRealPath();
    return new Promise((resolve, reject) => {
      let query = new AV.Query('Timer');
      query.equalTo("identity", identity);
      query.find().then(todos => {
        todos.forEach(todo => {
          todo.set("times", todo.attributes.times + 1);
        });
        return AV.Object.saveAll(todos);
      }).then(todos => resolve(true), error => reject(error));
    })
  }

  return {
    isExist,
    _get,
    update,
    create
  }
})()

const calcAndWriteTimes = () => {
  let isPost = true;

  let timerAllDOM = document.querySelectorAll(".article-timer");

  if(isPost) {
    let identity = timerAllDOM[0].getAttribute("data-identity");
    valineAPI.isExist(identity)
    .then(exist => {
      if(exist) {
        return valineAPI.update(identity);
      }
      return new Promise(resolve => resolve(true));
    })
    .then( succuess => valineAPI._get(identity))
    .then( result => timerAllDOM[0].innerText = result[0].attributes.times)
    .catch(error => console.log(error.message))
    return ;
  }

  let timerDOMCache = {};

  for(let timerDOM of timerAllDOM) {
    let identity = timerDOM.getAttribute("data-identity");
    if(timerDOMCache.hasOwnProperty(identity)){
      timerDOMCache[identity].dom.push(timerDOM);
    }else{
      timerDOMCache[identity] = {
        dom: [timerDOM],
        times: undefined
      };
    }
  }

  let identities = Object.keys(timerDOMCache);
  valineAPI._get(identities).then(results => {
    for(let result of results) {
      let {identity, times} = result.attributes;
      timerDOMCache[identity].times = times;
      timerDOMCache[identity].dom.map(item => item.innerText = times);
    }
    for(let identity of identities) {
      if(timerDOMCache[identity].times){
        continue;
      }
      timerDOMCache[identity].dom.map(item => item.innerText = 1);
      valineAPI.create(identity);
    }
  }).catch(error => console.log(error.message))
}

if(true){
  calcAndWriteTimes();
}
</script>
   

</div>


      <footer>
  <p class="site-info">
    博客已萌萌哒运行<span id="time-to-now"></span><span class="my-face">(●'◡'●)ﾉ♥</span>
    <br>
    Theme - <a href="https://github.com/dongyuanxin/theme-bmw">BMW</a> | Made With 💗 | Powered by <a href="https://godbmw.com/">GodBMW</a>
    <br>
    
  </p>
</footer>



<script>
const timeToNowDOM = document.querySelector("#time-to-now");
const startTimestamp = new Date(2019, 0, 16).getTime();

const updateTimeStr = () => {
  let offset = parseInt(
      (new Date().getTime() - startTimestamp) / 1000,
      10
    ),
    day = Math.floor(offset / 86400),
    hour = Math.floor((offset % 86400) / 3600),
    minute = Math.floor(((offset % 86400) % 3600) / 60),
    second = Math.floor(((offset % 86400) % 3600) % 60);
  timeToNowDOM.innerHTML =
    day + "天" + hour + "小时" + minute + "分钟" + second + "秒";
  setTimeout(updateTimeStr, 500);
}

setTimeout(updateTimeStr, 500);
</script>


      <div class="back-to-top hidden">
  <span>
    <i class="iconfont icon-60"></i><span></span>%
  </span>
</div>

<script>
const updateIconToTop = percent => {
  let dom = document.querySelector(".back-to-top span span");
  dom.innerText = percent;
  if(percent < 1) {
    document.querySelector(".back-to-top").className = "back-to-top hidden";
  } else {
    document.querySelector(".back-to-top").className = "back-to-top";
  }
}

const handleScoll = () => {
  let isRunning = false;
  return () => {
    if (isRunning) return;
    isRunning = true;
    window.requestAnimationFrame(timestamp => {
      let scrollTop =
          document.documentElement.scrollTop || document.body.scrollTop,
        scrollHeight =
          document.documentElement.scrollHeight ||
          document.body.scrollHeight,
        clientHeight =
          document.documentElement.clientHeight ||
          document.body.clientHeight;
      isRunning = false;
      if (scrollTop <= 1) {
        updateIconToTop(0);
        return;
      }
      if (scrollTop + clientHeight >= scrollHeight) {
        updateIconToTop(100);
      } else {
        updateIconToTop(parseInt(
          100 * scrollTop / (scrollHeight - clientHeight),
          10
        ));
      }
    });
  };
}

const backToTop = () => {
  let scrollTop =
      document.documentElement.scrollTop || document.body.scrollTop,
    delay = 10,
    time = 200;
  if (scrollTop <= 20) {
    document.documentElement.scrollTop = 0;
    document.body.scrollTop = 0;
    return;
  }
  let step = Math.ceil(scrollTop * delay / time);
  let timer = setInterval(() => {
    scrollTop =
      document.documentElement.scrollTop || document.body.scrollTop;
    if (scrollTop - step <= 0) {
      document.documentElement.scrollTop = 0;
      document.body.scrollTop = 0;
      clearInterval(timer);
    } else {
      document.documentElement.scrollTop = scrollTop - step;
      document.body.scrollTop = scrollTop - step;
    }
  }, delay);
}

document.addEventListener("scroll", handleScoll(), false);

document.querySelector(".back-to-top").addEventListener("click", backToTop, false);

</script>

    </div>

    
      <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML" async></script>
<script>
  (() => {
    const mathjaxConfig = {
      showProcessingMessages: false, //关闭js加载过程信息
      messageStyle: "none", //不显示信息
      jax: ["input/TeX", "output/HTML-CSS"],
      tex2jax: {
        inlineMath: [["$", "$"], ["\\(", "\\)"]], //行内公式选择符
        displayMath: [["$$", "$$"], ["\\[", "\\]"]], //段内公式选择符
        skipTags: ["script", "noscript", "style", "textarea", "pre", "code", "a"] //避开某些标签
      },
      "HTML-CSS": {
        availableFonts: ["STIX", "TeX"], //可选字体
        showMathMenu: false //关闭右击菜单显示
      }
    }

    let mathjaxInterval = setInterval(() => {
      if(!window.MathJax){
        return;
      }
      window.MathJax.Hub.Config(mathjaxConfig)
      window.MathJax.Hub.Queue(["Typeset", MathJax.Hub, document.getElementById('app')])

      clearInterval(mathjaxInterval)
    }, 10)    
  })()
</script>
    

    <script src="https://cdn.bootcss.com/fancybox/3.5.2/jquery.fancybox.min.js" async></script>
<script async>
  let fancyTimer = setInterval(function(){
    if(!window.$){
      return;
    }
    $(document).ready(function() {
      $(".post img").each(function () {
        if($(this).parent().get(0).tagName.toLowerCase() === "a") {
          return;
        }
        // $(this).attr("data-fancybox", "gallery"); // if you add 'data-fancybox', img will display after showed
        var element = document.createElement("a");
        $(element).attr("data-fancybox", "gallery");
        $(element).attr("href", $(this).attr("src"));
        $(this).wrap(element);
      });
      
      clearInterval(fancyTimer);
    });
  }, 10);
</script>

    
  </body>

</html>
